<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>
    
    function Model(){
        this.m1 = function(){
            return "hello"
        }
        this.m2 = function(){
            return "world"
        }
        this.m3 = function(){
            return "abc"
        }
        this.m4 = function(){
            return "你好"
        }
        this.m5 = function(){
            return "hi"
        }
    }
    function View(){
        this.v1 = function(d){
            console.log(d)
        }
        this.v2 = function(d){
            alert(d)
        }
        this.v3 = function(d){
            document.write(d)
        }
    }
    function Ctrl(){
        const m = new Model();
        const v = new View();
        this.c1 = function(){
            const d = m.m1();
            v.v2(d);
        }
        this.c2 = function(){
            const d = m.m2();
            v.v3(d);
        }
        this.c3 = function(){
            const d = m.m3();
            v.v1(d);
        }
        this.c4 = function(){
            const d = m.m4();
            v.v2(d);
        }
    }

    const c = new Ctrl()
    c.c2();
    
    c.c3();

    c.c4();

    c.c1();

</script>
</html>